import { Audio } from 'expo-av';

export const requestPermissions = async () => {
  try {
    // 请求麦克风权限
    const audioResult = await Audio.requestPermissionsAsync();
    if (!audioResult.granted) {
      throw new Error('需要麦克风权限才能使用语音功能');
    }

    return true;
  } catch (error) {
    console.error('权限请求失败:', error);
    throw error;
  }
}; 